from machine import PWM,Pin
import time

beep = PWM(Pin(2))

print("蜂鸣器响!!")
beep.freq(1000)
beep.duty(100)

time.sleep(2)

beep.duty(0)
